import java.util.ArrayList;

public class Folder extends AbstractFile{
    private ArrayList<AbstractFile> fileList=new ArrayList<AbstractFile>();
    @Override
    public boolean add(AbstractFile file) {
        return fileList.add(file);
    }

    @Override
    public boolean remove(AbstractFile file) {
        return fileList.remove(file);
    }

    @Override
    public AbstractFile getChild(int index) {
        return fileList.get(index);
    }

    @Override
    public String Openfile() {
        for(AbstractFile file : fileList) {
            System.out.println(file.Openfile());
        }
        return "这是文件夹";
    }

}
